//
//  ZXChoicePartView.m
//  ZiJinLian
//
//  Created by 震霄 张 on 2018/3/11.
//  Copyright © 2018年 lzy. All rights reserved.
//

#import "ZXChoicePartView.h"

@interface ZXChoicePartView()
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *imageH;
@property (weak, nonatomic) IBOutlet UIImageView *iconView;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *subTitleLabel;

@end

@implementation ZXChoicePartView

+(instancetype)zxchoicePartView
{
	return [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil].lastObject;
}
-(void)awakeFromNib
{
	[super awakeFromNib];
	self.autoresizingMask = UIViewAutoresizingNone;
	self.imageH.constant = (MainW-50)/16*9;
	
}
- (IBAction)bgBtnCLick:(id)sender {
	NSLog(@"click quality");
	NSMutableDictionary *dic = [NSMutableDictionary dictionary];
	[dic setValue:@"1" forKey:@"type"];
	[dic setValue:self.model.imageLink forKey:@"value"];
	[[NSNotificationCenter defaultCenter]postNotificationName:@"jumpOther" object:nil userInfo:dic];
	
}
-(void)setModel:(HomeQualityModel *)model
{
	_model = model;
	[self.iconView sd_setImageWithURL:[NSURL URLWithString:model.imageUrl] placeholderImage:[UIImage imageNamed:@""]];
	self.titleLabel.text = model.title;
	self.subTitleLabel.text = model.subtitle;
	
}

@end
